<?php
return [
    'view.namespace' => 'Account',
    'auth.route_middleware' => [
        \App\SubApps\Account\Middleware\OauthAppMiddleware::class,
    ],
    'auth.providers.users' => [
        'driver' => 'eloquent',
        'model' => \App\SubApps\Account\Models\AuthUsersModel::class,
        'model_login_log' => \App\SubApps\Account\Models\AuthUsersLoginLogModelAuth::class,
        'single_client_login' => 'all',//是否单点登录 all 所有端单点，platform 同平台单点

        'allow_account_login' => true, //允许使用账号登录
        'login_use_image_captcha' => true, //账号登录使用图形验证码(需要验证码服务)
        'allow_mobile_login' => true, //允许使用手机号验证登录(需要验证码服务)
        'allow_email_login' => true, //允许使用邮箱验证登录(需要验证码服务)

        'allow_third_path_login' => '',//允许第三方登录，值为 third_party_login.providers 下的键

        'allow_register' => true, //允许注册
        'register_need_mobile' => true, //注册需要填手机号
        'register_check_mobile' => true,//注册需要验证手机号
        'register_need_email' => true, //注册需要填邮箱
        'register_check_email' => false,//注册需要验证邮箱
        'allow_mobile_reset_pass' => true,//允许使用手机号找回密码
        'allow_email_reset_pass' => false,//允许使用邮箱找回密码

    ],
    'menus' => [
        'main' => [

            [
                "name" => "联系我们",
                "index" => "web.home.contact",
                "href" => "contact",
                "target" => '_callback'
            ],
        ],
        'console' => [
            [
                "name" => "我的资料",
                "index" => "web.console.users.profile",
                "route_name" => 'web.console.users.profile',
            ],
            [
                "name" => "登录应用管理",
                "index" => "web.console.oauth-apps",
                "route_name" => "web.console.oauth-apps",
                "target" => '',
                'children' => [
                    [
                        "name" => "应用列表",
                        "index" => "web.console.oauth-apps",
                        "route_name" => "web.console.oauth-apps",
                        "target" => '',
                    ],
                    [
                        "name" => "应用登录日志",
                        "index" => "web.console.oauth-apps.login-logs",
                        "route_name" => "web.console.oauth-apps.login-logs",
                        "target" => '',
                    ]
                ],
            ],
            [
                "name" => "我的积分",
                "index" => "web.home.b",
                "href" => "积分",
                "target" => '_callback'
            ],
            [
                "name" => "权限管理",
                "index" => "web.console.access-control",
                "route_name" => "web.console.access-control.entities",
                "target" => '',
                'children' => [
                    [
                        "name" => "权限列表",
                        "index" => "web.console.access-control.entities",
                        "route_name" => "web.console.access-control.entities",
                        "target" => '',
                    ],
                    [
                        "name" => "权限组",
                        "index" => "web.console.access-control.roles",
                        "route_name" => "web.console.access-control.roles",
                        "target" => '',
                    ],
                    [
                        "name" => "用户权限",
                        "index" => "web.console.access-control.users",
                        "route_name" => "web.console.access-control.users",
                        "target" => '',
                    ]
                ],
            ],
        ],
    ],

    'access_control.route' =>[
        'prefix' => '',
        'middleware' => ['auth:web','can:allow,"access_control"'],
        'controller' => \App\SubApps\Account\Controllers\AccessControlController::class,
    ],


    'filesystems.disks.avatars' => [
        'driver' => 'local',
        'root' => storage_path('account/avatars'),
        'url' => '/files/view/avatars',
        'visibility' => 'public',
    ],
    'filesystems.disks.oauth_logos' => [
        'driver' => 'local',
        'root' => storage_path('account/oauth_logos'),
        'url' => '/files/view/oauth_logos',
        'visibility' => 'public',
    ],
    'filesystems.disks.editor' => [
        'driver' => 'local',
        'root' => storage_path('account/editor'),
        'url' => '/files/view/editor',
        'visibility' => 'public',
    ],
    'file_service.upload.routes.editor' => [
        'disk' => 'editor',
        'domain' => null,
        'middleware' => ['auth:web,api'],
        'max_size' => 1024 * 1024 *  2,
        'allow_ext' => [
            'jpg','jpeg','png','gif'
        ],
    ],

];
